// 验证码
export interface YZM {
  id: number
  key: string
  value: string
}

// 登录
export interface Login {
  email: string
  password: string
}
// pinia 用户信息
export interface UserToken {
  empId: number
  username: string
  email: string
  headImg: string
  token: string
}

// 重置密码
export interface PwdForm {
  email: string
  oldPassword: string
  newPassword: string
  surePassowrd: string
}

export interface TagInfo {
  name: string
  path: string
}
// 用户基本信息
export interface User {
  empId: number
  username: string
  email: string
  headImg: string
  sex: string
  marry: string
  birth: string
  entryTime: string
  firstJobTime: string
  status: string
  authorityId: number
  posId: number
  deptId: number
  createTime: string
  updateTime: string
  deptName: string
  posName: string
  level: number
}
// 新增职员
export interface AddStaffInfo {
  username: string
  // //添加登录名 ----> 登录名改为邮箱字段
  loginName: string
  password: string
  email: string
  sex: string
  birth: string
  entryTime: string
  firstJobTime: string
  //添加月薪
  salary: string
  authority: string
  deptName: string
  posName: string
  //添加考勤方式
  checkType: string
  headImg: string
}
// 用户部门履历
export interface DeptHis {
  deptId: number
  empId: number
  startTime: string
  endTime: string
  username: string
  deptName: string
}

// 用户部门履历
export interface PosHis {
  posId: number
  empId: number
  startTime: string
  endTime: string
  username: string
  posName: string
}
//职位信息
export interface Pos {
  posId: number
  posName: string
  level: number
  status: string
  isReverted: boolean
}
//新增职位信息
export interface AddPos {
  posName: string
  level: number
}
//修改职位信息
export interface updatePos {
  posName: string
  level: number
  posId: number
}

//查看部门员工信息

export interface PosOfStaff {
  empId: number
  username: string
  deptName: string
  sex: string
  age: number
}

//员工信息管理
export interface StaffInfo {
  empId: number
  username: string
  sex: string
  posName: string
  deptName: string
  status: string
  isReverted: boolean
}
export interface DeptList {
  deptId: number
  deptName: string
  empId: number
  leader: string
  status: string
  allPeople: number
  deptSuper: string
}
export interface DeptInfo {
  deptId: number
  deptName: string
  deptLeader: string
  status: string
  allPeople: number
  deptSuper: string
  createTime: string
}

// 打卡
export interface Clock {
  username: string
  clockInTime: string
  clockOutTime: string
}

// 未打卡
export interface NotClock {
  id: number
  empId: number
  username: string
  date: string
  checkInTime: string
  checkOutTime: string
  reason: string
  status: string
  auditorName: string
}

// 
export interface ClockPage {
  status: string
  pageNum: number
  pageSize: number
}

export interface UpdateClock {
  id: number
  checkInTime: string
  checkOutTime: string
  reason: string
  status: string
}
export interface DeptEmp {
  empId: number
  username: string
  sex: string
  positionName: string
  birth: string
}
export interface DeptAdd {
  deptName: string
  deptLeader: number
  allPeople: number
  deptSuper: number
}
export interface updateDept {
  deptId: number
  deptName: string
  deptLeader: number
  allPeople: number
  deptSuper: number
}
export interface schedule{
  id:number
  type:string
  checkInTime:string
  checkOutTime:string
 
}
export interface scheduleAdd{
  type:string
  checkInTime:string
  checkOutTime:string
 
}
export interface ShenPiRen{
  deptId:number
  deptName:string
  attAppId:number
  attAppName:string
  leaveAppId:number
  leaveAppName:string
 
}
export interface KaoQinRen{
  empId:number
  userName:string
  authorityId:number
  name:string
}
export interface updateShenPiRen{
  deptId:number
  attAppId:number
  leaveAppId:number
}
export interface Authority {
  authorityId: number
  name: string
}
export interface StaffUpdate {
  empId: number
  username: string
  sex: string
  birthStr: string
  firstJobTimeStr: string
  loginName: string
  authority: number
}

export interface checkType {
  checkId: number
  type: string
}

export interface selectStaffInfo {
  username: string
  sex: string
  posId: string
  deptId: string
  entryTime: string
  status:string
}
//员工排班信息
export interface staffSchedule {
  empId: number
  username: string
  deptName: string
  type: string
  posName:string
  id:number
  
}
//更新
export interface updateStaffSchedule {
  empId: number
  type: string
}

//新增
export interface addLeave {
  id: number
  type: string
  limitDays: string
}


export interface Agree {
  ids: number[]
  status: string
}
export interface updateEmpDept {
  empId: number
  deptId: number
}
export interface updateEmpPos {
  empId: number
  posId: number
}

//休假记录 审批休假
export interface Leave {
  id: number
  empId: number
  beginTime: string
  endTime: string
  leave_type_id: number
  days: number
  reason: string
  status: string

  username: string
  //leave_type表中的type字段
  type: string
}
export function  newFunction(Time: string) {
  const date = new Date(Time)
  const year = date.getFullYear()
  const month = (date.getMonth() + 1).toString().padStart(2, '0') // 月份从0开始，需要加1，并使用padStart填充前导零
  const day = date.getDate().toString().padStart(2, '0') // 使用padStart填充前导零

  //具体时间
  const hours = date.getHours().toString().padStart(2, '0') // 使用padStart填充前导零
  const minutes = date.getMinutes().toString().padStart(2, '0') // 使用padStart填充前导零

  // 组合成年月日格式
  const formattedDate = `${year}-${month}-${day}  ${hours}:${minutes}`
  // leaveList.value![i].beginTime = formattedDate
  return formattedDate
}
